#pragma once

#include "Control.h"


namespace mcore
{
	class View
	{
	public:
		View()
		{
			mName = "Empty View";
		}
		virtual ~View()
		{
		}

		void load() { mGui = new mgui::Control; }
		virtual void unload() { SAFE_DELETE(mGui); }
		virtual void onResize() {}
		virtual void update(float dt) {}
		virtual void draw() {}
		// returns whether it handled a message; it's not being used currently anyway!
		virtual bool onWindowMessage(UINT msg, WPARAM wParam, LPARAM lParam) = 0;

		const std::string & getName() { return mName; }

	protected:
		bool sendInputToGUI(UINT msg, WPARAM wParam, LPARAM lParam);

		std::string mName;

		mgui::Control * mGui;
	};

}
